package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"strings"
)

func main() {
	//client
	client := &http.Client{}
	req, err := http.NewRequest("POST", "http://localhost/healthz", strings.NewReader("key=value"))
	if err !=nil{
		fmt.Println(err)
		os.Exit(1)
		return
	}
	req.Header.Set("Cookie","testCookie")
	req.Header.Set("token","d8cdcf8427e")
	resp,err:=client.Do(req)
	if err!=nil{
		fmt.Println(err)
		os.Exit(1)
		return
	}
	defer resp.Body.Close()
	data,err:=ioutil.ReadAll(resp.Body)
	fmt.Println(string(data))
	if len(resp.Header)>0{
		for k,v:=range resp.Header{
			fmt.Printf("resq header: %s=%s\n",k,v)
		}
	}

	defer resp.Body.Close()
}

